{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import yaml\n",
    "import json\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = '../DM_model/smarthome_AC_story.yml'\n",
    "with open(path, 'r', encoding='utf-8') as f:\n",
    "    dataset = yaml.load(f.read(),Loader=yaml.Loader)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 输入\n",
    "    - Previous system action\n",
    "    - System Action\n",
    "    - Slots\n",
    "    - User intent entities"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{'intent': 'Control-AC_Open', 'entities': [{'address': '主卧'}, {'device': '空调'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'device': '空调'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_ac', 'entities': [{'address': '客厅'}, {'device': '空调'}]}, {'action': 'action_open_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'device': '空调'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_room', 'entities': [{'address': '客厅'}]}, {'action': 'action_open_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'device': '空调'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_range', 'entities': [{'range': '所有'}]}, {'action': 'action_open_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'range': '所有'}, {'device': '空调'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '客厅'}]}, {'action': 'action_open_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_room', 'entities': [{'address': '客厅'}]}, {'action': 'action_open_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'address': '客厅'}, {'device': '空调'}, {'operation': '关闭'}]}, {'action': 'action_close_ac'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'device': '空调'}, {'operation': '关闭'}]}, {'action': 'action_close_ac'}, {'intent': 'inform_ac', 'entities': [{'address': '客厅'}, {'device': '空调'}]}, {'action': 'action_close_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'range': '所有'}, {'device': '空调'}, {'operation': '关闭'}]}, {'action': 'action_close_ac'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'operation': '关闭'}, {'device': '空调'}]}, {'action': 'action_close_ac'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '书房'}]}, {'action': 'action_close_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'operation': '关闭'}, {'device': '空调'}]}, {'action': 'action_close_ac'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_close_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Close', 'entities': [{'operation': '关闭'}, {'device': '空调'}]}, {'action': 'action_close_ac'}, {'intent': 'inform_range', 'entities': [{'range': '所有'}]}, {'action': 'action_close_ac'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Mode', 'entities': [{'address': '客厅'}, {'device': '空调'}, {'mode': '制热模式'}]}, {'action': 'acmode_form'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Mode', 'entities': [{'mode': '节能模式'}]}, {'action': 'acmode_form'}, {'intent': 'inform_ac', 'entities': [{'address': '客厅'}, {'device': '空调'}]}, {'action': 'acmode_form'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Mode', 'entities': [{'device': '空调'}, {'mode': '节能模式'}]}, {'action': 'acmode_form'}, {'active_loop': 'acmode_form'}, {'intent': 'inform_ac', 'entities': [{'address': '主卧'}, {'device': '空调'}]}, {'action': 'acmode_form'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}, {'address': '书房'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Mode', 'entities': [{'mode': '节能模式'}]}, {'action': 'acmode_form'}, {'intent': 'Control-AC_Mode', 'entities': [{'mode': '左右扫风'}]}, {'action': 'acmode_form'}]\n",
      "3\n",
      "/n\n",
      "[{'intent': 'Control-AC_Timing', 'entities': [{'time': '一小时'}, {'operation': '关闭'}, {'device': '空调'}, {'address': '主卧'}]}, {'action': 'actiming_form'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Timing', 'entities': [{'time': '一小时'}, {'operation': '关闭'}, {'device': '空调'}]}, {'action': 'actiming_form'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '主卧'}]}, {'action': 'actiming_form'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Timing', 'entities': [{'time': '一小时'}, {'operation': '关闭'}, {'device': '空调'}]}, {'action': 'actiming_form'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'actiming_form'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Timing'}, {'action': 'actiming_form'}, {'intent': 'Control-AC_Timing', 'entities': [{'time': '一小时'}, {'operation': '关闭'}, {'device': '空调'}]}, {'action': 'actiming_form'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '主卧'}]}, {'action': 'actiming_form'}]\n",
      "3\n",
      "/n\n",
      "[{'intent': 'Control-AC_Timing', 'entities': [{'time': '五小时'}, {'operation': '关闭'}, {'home_device': '空调'}]}, {'action': 'actiming_form'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'actiming_form'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Timing', 'entities': [{'time': '一小时'}, {'operation': '关闭'}]}, {'action': 'actiming_form'}]\n",
      "3\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'operation': '增大'}, {'target': '风速'}, {'device': '空调'}, {'address': '客厅'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'sensorvalue': '最大'}, {'target': '风速'}, {'device': '客厅空调'}, {'address': '客厅'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'operation': '调高'}, {'target': '风速'}, {'device': '空调'}]}, {'action': 'action_controlDeviceWind'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'operation': '调高'}, {'device': '空调'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'operation': '调高'}, {'device': '空调'}, {'address': '主卧'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Wind', 'entities': [{'operation': '调高'}, {'device': '空调'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '主卧'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}, {'address': '主卧'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Wind', 'entities': [{'sensorvalue': '最大'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}, {'intent': 'Control-AC_Wind', 'entities': [{'sensorvalue': '最小'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '主卧'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "4\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}, {'address': '书房'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Wind', 'entities': [{'device': '空调'}, {'address': '书房'}, {'operation': '增大'}, {'target': '风速'}]}, {'action': 'action_controlDeviceWind'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'address': '主卧'}, {'operation': '调高到'}, {'temperature': '二十度'}]}, {'action': 'action_controlactemp'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Temp', 'entities': [{'address': '客厅'}, {'device': '空调'}, {'operation': '调高'}, {'temperature': '一度'}]}, {'action': 'action_controlactemp'}]\n",
      "1\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'device': '空调'}, {'address': '主卧'}, {'operation': '打开'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'operation': '调高到'}, {'temperature': '二十五度'}]}, {'action': 'action_controlactemp'}, {'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'operation': '调高'}, {'temperature': '两度'}]}, {'action': 'action_controlactemp'}, {'intent': 'Control-AC_Close', 'entities': [{'operation': '关闭'}, {'device': '空调'}]}, {'action': 'action_close_ac'}]\n",
      "4\n",
      "/n\n",
      "[{'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'operation': '调高到'}, {'temperature': '二十五度'}]}, {'action': 'action_controlactemp'}, {'intent': 'inform_ac', 'entities': [{'device': '空调'}, {'address': '主卧'}]}, {'action': 'action_controlactemp'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'operation': '调高到'}, {'temperature': '二十五度'}]}, {'action': 'action_controlactemp'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_controlactemp'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_ac', 'entities': [{'address': '主卧'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Temp', 'entities': [{'temperature': '二十五度'}, {'target': '温度'}]}, {'action': 'action_controlactemp'}]\n",
      "3\n",
      "/n\n",
      "[{'intent': 'Control-AC_Open', 'entities': [{'operation': '打开'}, {'device': '空调'}]}, {'action': 'action_open_ac'}, {'intent': 'inform_ac', 'entities': [{'address': '客厅'}]}, {'action': 'action_open_ac'}, {'intent': 'Control-AC_Temp', 'entities': [{'target': '温度'}, {'operation': '调高'}]}, {'action': 'action_controlactemp'}]\n",
      "3\n",
      "/n\n",
      "[{'intent': 'Control-AC_Temp', 'entities': [{'device': '空调'}, {'target': '温度'}, {'operation': '调高'}]}, {'action': 'action_controlactemp'}, {'intent': 'inform_room', 'entities': [{'address': '主卧'}]}, {'action': 'action_controlactemp'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'latent_control_temp'}, {'action': 'action_latent_control_temp'}, {'intent': 'affirm'}, {'action': 'action_affirm_opensetaircondition'}]\n",
      "2\n",
      "/n\n",
      "[{'intent': 'latent_control_temp'}, {'action': 'action_latent_control_temp'}, {'intent': 'deny'}, {'action': 'action_deny_opensetaircondition'}]\n",
      "2\n",
      "/n\n"
     ]
    }
   ],
   "source": [
    "for i in dataset['stories']:\n",
    "    print(i['steps'])\n",
    "    print(len(i['steps'])//2)\n",
    "    print('/n')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Construct dataset map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def construct_dataset(dataset):\n",
    "    # 将数据集的 intent entities 以及action 的类别抽取出来\n",
    "    intent_set = ['PAD']\n",
    "    entities_set = ['PAD']\n",
    "    action_set = ['PAD']\n",
    "    for v in dataset['stories']:\n",
    "        worth = v['steps']\n",
    "        for i in worth:\n",
    "            for key, val in i.items():losses\n",
    "                if key  == 'intent':\n",
    "                    intent_set.append(val)\n",
    "                if key == \"action\":\n",
    "                    action_set.append(val)\n",
    "                if key == 'entities':\n",
    "                    for i in val:\n",
    "                        for key , value in i.items():\n",
    "                            entities_set.append(key)\n",
    "    return set(intent_set), set(entities_set), set(action_set)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "intent: {'PAD', 'inform_range', 'Control-AC_Temp', 'Control-AC_Open', 'Control-AC_Timing', 'latent_control_temp', 'deny', 'inform_ac', 'Control-AC_Mode', 'affirm', 'inform_room', 'Control-AC_Close', 'Control-AC_Wind'} \n",
      " inetent_len : 13\n",
      "entities: {'PAD', 'temperature', 'address', 'range', 'mode', 'device', 'sensorvalue', 'time', 'target', 'operation'} \n",
      " entities_len : 10\n",
      "action: {'PAD', 'action_close_ac', 'action_latent_control_temp', 'action_controlactemp', 'actiming_form', 'action_controlDeviceWind', 'action_deny_opensetaircondition', 'action_open_ac', 'action_affirm_opensetaircondition', 'acmode_form'} \n",
      " action_len : 10\n"
     ]
    }
   ],
   "source": [
    "intent, entities, action = construct_dataset(dataset)\n",
    "print('intent: {} \\n inetent_len : {}'.format(intent,len(intent)))\n",
    "print('entities: {} \\n entities_len : {}'.format(entities,len(entities)))\n",
    "print('action: {} \\n action_len : {}'.format(action, len(action)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构建意图索引\n",
    "intent2id = {}\n",
    "for index, val in enumerate(intent):\n",
    "    intent2id.update({val:index})\n",
    "\n",
    "id2intent = {}\n",
    "for index, val in enumerate(intent):\n",
    "    id2intent.update({index:val})  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构建槽位索引\n",
    "entities2id = {}\n",
    "for index, val in enumerate(entities):\n",
    "    entities2id.update({val:index})\n",
    "\n",
    "id2entities = {}\n",
    "for index, val in enumerate(entities):\n",
    "    id2entities.update({index:val}) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 构建动作索引\n",
    "action2id = {}\n",
    "for index, val in enumerate(action):\n",
    "    action2id.update({val:index})\n",
    "\n",
    "id2action = {}\n",
    "for index, val in enumerate(action):\n",
    "    id2action.update({index:val})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将label2id 转为字典以json文件储存\n",
    "char = {}\n",
    "char.update({'action2id' : action2id})\n",
    "char.update({'id2action' : id2action})\n",
    "char.update({'intent2id' : intent2id})\n",
    "char.update({'id2intent' : id2intent})\n",
    "char.update({'entities2id' : entities2id})\n",
    "char.update({'id2entities' : id2entities})\n",
    "\n",
    "with open('./DM_char.json', mode='w', encoding='utf-8') as f:\n",
    "    json.dump(char, f)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# extract dataset\n",
    "    - max_history 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "def split_data(dataset):\n",
    "    # 以对话历史最长为3分割，以数组形式储存数据\n",
    "    data_set = []\n",
    "    num = 0\n",
    "    for val in dataset['stories']:\n",
    "        data = val['steps']\n",
    "        num += 1\n",
    "#         print(num)\n",
    "        for index in range(0,len(data),2):\n",
    "\n",
    "            previous_action = []\n",
    "            actions = []\n",
    "            slots = []\n",
    "            user_intent = []\n",
    "\n",
    "            # 当前状态\n",
    "            current_intent  =  data[index]['intent']\n",
    "            if 'entities' in data[index].keys():\n",
    "                current_slot = data[index]['entities']\n",
    "            elif 'entities' not in data[index].keys():\n",
    "                current_slot = []\n",
    "            current_action = data[index+1]['action']\n",
    "\n",
    "            # 前一时刻状态\n",
    "            pre1_intent = []\n",
    "            pre1_slot = []\n",
    "            pre1_action = []\n",
    "\n",
    "            # 前二时刻状态\n",
    "            pre2_intent = []\n",
    "            pre2_slot = []\n",
    "            pre2_action = [] \n",
    "\n",
    "            pre_history_1 = index-2\n",
    "            pre_history_2 = index-4\n",
    "\n",
    "            #判断对话历史是否存在\n",
    "            if pre_history_1 >= 0:\n",
    "                pre1_intent = data[pre_history_1]['intent']\n",
    "                if 'entities' in data[pre_history_1].keys():\n",
    "                    pre1_slot = data[pre_history_1]['entities']\n",
    "                pre1_action = data[pre_history_1+1]['action']\n",
    "\n",
    "            if pre_history_2 >= 0:\n",
    "                pre2_intent = data[pre_history_2]['intent']\n",
    "                if 'entities' in data[pre_history_2].keys():\n",
    "                    pre2_slot = data[pre_history_2]['entities']\n",
    "                pre2_action = data[pre_history_2+1]['action'] \n",
    "        \n",
    "            previous_action_sum = [pre1_action, pre2_action]\n",
    "            for i in previous_action_sum:\n",
    "                if i != []:\n",
    "                    previous_action.append(i)\n",
    "            if previous_action == []:\n",
    "                previous_action = ['PAD']\n",
    "#             print('previous_action: ', previous_action)\n",
    "\n",
    "            \n",
    "            actions = [current_action]\n",
    "#             print('actions: ',actions)\n",
    "            \n",
    "            slots_sum = [current_slot , pre1_slot , pre2_slot]            \n",
    "            for i in slots_sum:\n",
    "                if i  != []:\n",
    "                    for val in i:\n",
    "                        for key, j in val.items():\n",
    "                            if key not in slots:\n",
    "                                slots.append((key))\n",
    "            if slots == []:\n",
    "                slots = ['PAD']\n",
    "#             print('slots:',slots)\n",
    "            \n",
    "            \n",
    "            user_intent_sum= [current_intent , pre1_intent , pre2_intent]\n",
    "            for i in user_intent_sum:\n",
    "                if i != []:\n",
    "                    user_intent.append(i)\n",
    "            if user_intent == []:\n",
    "                user_intent = ['PAD']\n",
    "#             print('user_intent: ',user_intent)\n",
    "\n",
    "            data_set.append({'previous_action':previous_action, 'slots':slots,'user_intent':user_intent, 'action':actions})\n",
    "    return data_set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "data_set = split_data(predataset)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "def trans2labelid(vocab,x):\n",
    "        max_len = len(vocab)\n",
    "        labels = [vocab[label] for label in x]\n",
    "        label_onehot = np.eye(max_len)[labels]\n",
    "        values = sum(label_onehot)\n",
    "        return values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "def extract_conv_data(data_set):\n",
    "    dataset_previous_action = []\n",
    "    dataset_slots = []\n",
    "    dataset_user_intent = [ValueError: 'previous_action_inputs ' is not a valid scope name]\n",
    "    dataset_action = []\n",
    "    for i in data_set:\n",
    "        previous_action = i['previous_action']\n",
    "        dataset_previous_action.append(trans2labelid(action2id,previous_action))\n",
    "        slots = i['slots']\n",
    "        dataset_slots.append(trans2labelid(entities2id,slots))\n",
    "        user_intent = i['user_intent']\n",
    "        dataset_user_intent.append(trans2labelid(intent2id,user_intent))\n",
    "        action = i['action']\n",
    "        dataset_action.append(trans2labelid(action2id,action))\n",
    "    \n",
    "    return np.array(dataset_previous_action), np.array(dataset_slots), \\\n",
    "            np.array(dataset_user_intent), np.array(dataset_action)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "previous_action, slots, user_intent, action = extract_conv_data(data_set) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2.3.0'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "import json\n",
    "import codecs\n",
    "import numpy as np\n",
    "import tensorflow as tf\n",
    "\n",
    "os.environ[\"CUDA_VISIBLE_DEVICES\"] = '0'\n",
    "gpus = tf.config.experimental.list_physical_devices(device_type='GPU')\n",
    "for gpu in gpus:\n",
    "    tf.config.experimental.set_memory_growth(gpu, True)\n",
    "tf.__version__"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "params = {\n",
    "    'batch_size': 32,\n",
    "    'lr' : 0.001,\n",
    "    'epochs': 500,\n",
    "    'drops' : [0.1]\n",
    "         }"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10\n",
      "10\n",
      "13\n"
     ]
    }
   ],
   "source": [
    "previous_action_len = len(action2id)\n",
    "print(previous_action_len)\n",
    "slots_len = len(entities2id)\n",
    "print(slots_len)\n",
    "user_intent_len = len(intent2id)\n",
    "print(user_intent_len)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "def Dataset(previous_action_inputs, slots_inputs,user_intent_inputs,pre_action):\n",
    "    dataset = tf.data.Dataset.from_tensor_slices(({\n",
    "    \"previous_action_inputs\" : previous_action_inputs,\n",
    "    \"slots_inputs\" : slots_inputs,\n",
    "    \"user_intent_inputs\" : user_intent_inputs\n",
    "    },\n",
    "    {\n",
    "        \"pre_action\" : pre_action\n",
    "    }))\n",
    "    dataset = dataset.batch(params['batch_size'])\n",
    "    return dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_dataset =  Dataset(previous_action, slots, user_intent, action)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BatchDataset shapes: ({previous_action_inputs: (None, 10), slots_inputs: (None, 10), user_intent_inputs: (None, 13)}, {pre_action: (None, 10)}), types: ({previous_action_inputs: tf.float64, slots_inputs: tf.float64, user_intent_inputs: tf.float64}, {pre_action: tf.float64})>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train_dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"functional_1\"\n",
      "__________________________________________________________________________________________________\n",
      "Layer (type)                    Output Shape         Param #     Connected to                     \n",
      "==================================================================================================\n",
      "previous_action_inputs (InputLa [(None, 10)]         0                                            \n",
      "__________________________________________________________________________________________________\n",
      "slots_inputs (InputLayer)       [(None, 10)]         0                                            \n",
      "__________________________________________________________________________________________________\n",
      "user_intent_inputs (InputLayer) [(None, 13)]         0                                            \n",
      "__________________________________________________________________________________________________\n",
      "embedding (Embedding)           (None, 10, 32)       4096        previous_action_inputs[0][0]     \n",
      "__________________________________________________________________________________________________\n",
      "embedding_1 (Embedding)         (None, 10, 32)       4096        slots_inputs[0][0]               \n",
      "__________________________________________________________________________________________________\n",
      "embedding_2 (Embedding)         (None, 13, 32)       4096        user_intent_inputs[0][0]         \n",
      "__________________________________________________________________________________________________\n",
      "concatenate (Concatenate)       (None, 33, 32)       0           embedding[0][0]                  \n",
      "                                                                 embedding_1[0][0]                \n",
      "                                                                 embedding_2[0][0]                \n",
      "__________________________________________________________________________________________________\n",
      "bidirectional (Bidirectional)   (None, 33, 128)      37632       concatenate[0][0]                \n",
      "__________________________________________________________________________________________________\n",
      "layer_normalization (LayerNorma (None, 33, 128)      256         bidirectional[0][0]              \n",
      "__________________________________________________________________________________________________\n",
      "global_average_pooling1d (Globa (None, 128)          0           layer_normalization[0][0]        \n",
      "__________________________________________________________________________________________________\n",
      "pre_action (Dense)              (None, 10)           1290        global_average_pooling1d[0][0]   \n",
      "==================================================================================================\n",
      "Total params: 51,466\n",
      "Trainable params: 51,466\n",
      "Non-trainable params: 0\n",
      "__________________________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "tf.keras.backend.clear_session()\n",
    "previous_action_inputs = tf.keras.layers.Input(shape=(previous_action_len,), name = 'previous_action_inputs')\n",
    "slots_inputs = tf.keras.layers.Input(shape = (slots_len,), name = 'slots_inputs')\n",
    "user_intent_inputs = tf.keras.layers.Input(shape = (user_intent_len,), name = 'user_intent_inputs')\n",
    "\n",
    "previous_action_embed = tf.keras.layers.Embedding(128,32)(previous_action_inputs)\n",
    "slots_embed = tf.keras.layers.Embedding(128,32)(slots_inputs)\n",
    "user_intent_embed = tf.keras.layers.Embedding(128,32)(user_intent_inputs)\n",
    "\n",
    "utter_inputs = tf.keras.layers.concatenate([previous_action_embed,slots_embed,user_intent_embed],axis=1)\n",
    "bilstm = tf.keras.layers.Bidirectional(tf.keras.layers.GRU(64,return_sequences=True))(utter_inputs)\n",
    "x_in = tf.keras.layers.LayerNormalization()(bilstm)\n",
    "x_conv = tf.keras.layers.GlobalAveragePooling1D()(x_in)\n",
    "pre_action = tf.keras.layers.Dense(previous_action_len, activation='sigmoid',name = 'pre_action')(x_conv)\n",
    "model = tf.keras.Model([previous_action_inputs,slots_inputs,user_intent_inputs],pre_action)\n",
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "losses = {'pre_action': 'sparse_categorical_crossentropy'}\n",
    "metrics = {'pre_action': ['accuracy']}\n",
    "optimizer = tf.keras.optimizers.Adam(params['lr'])\n",
    "model.compile(optimizer, loss=tf.keras.losses.categorical_crossentropy, metrics=metrics)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.2766 - accuracy: 0.9125\n",
      "Epoch 2/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1435 - accuracy: 0.9250\n",
      "Epoch 3/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.3135 - accuracy: 0.9125\n",
      "Epoch 4/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.4637 - accuracy: 0.8500\n",
      "Epoch 5/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.4769 - accuracy: 0.8500\n",
      "Epoch 6/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.3734 - accuracy: 0.8875\n",
      "Epoch 7/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.3049 - accuracy: 0.9125\n",
      "Epoch 8/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.2214 - accuracy: 0.9375\n",
      "Epoch 9/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1733 - accuracy: 0.9500\n",
      "Epoch 10/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1881 - accuracy: 0.9500\n",
      "Epoch 11/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1526 - accuracy: 0.9500\n",
      "Epoch 12/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1527 - accuracy: 0.9500\n",
      "Epoch 13/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1540 - accuracy: 0.9500\n",
      "Epoch 14/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1537 - accuracy: 0.9500\n",
      "Epoch 15/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1497 - accuracy: 0.9500\n",
      "Epoch 16/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1443 - accuracy: 0.9500\n",
      "Epoch 17/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1398 - accuracy: 0.9500\n",
      "Epoch 18/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1329 - accuracy: 0.9500\n",
      "Epoch 19/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1250 - accuracy: 0.9500\n",
      "Epoch 20/500\n",
      "2/2 [==============================] - 0s 7ms/step - loss: 0.1152 - accuracy: 0.9500\n",
      "Epoch 21/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.1064 - accuracy: 0.9500\n",
      "Epoch 22/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.1016 - accuracy: 0.9625\n",
      "Epoch 23/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0982 - accuracy: 0.9625\n",
      "Epoch 24/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0991 - accuracy: 0.9625\n",
      "Epoch 25/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0982 - accuracy: 0.9625\n",
      "Epoch 26/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0961 - accuracy: 0.9625\n",
      "Epoch 27/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0945 - accuracy: 0.9625\n",
      "Epoch 28/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0914 - accuracy: 0.9625\n",
      "Epoch 29/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0895 - accuracy: 0.9625\n",
      "Epoch 30/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0901 - accuracy: 0.9625\n",
      "Epoch 31/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0909 - accuracy: 0.9625\n",
      "Epoch 32/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0890 - accuracy: 0.9625\n",
      "Epoch 33/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0860 - accuracy: 0.9625\n",
      "Epoch 34/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0838 - accuracy: 0.9625\n",
      "Epoch 35/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0819 - accuracy: 0.9625\n",
      "Epoch 36/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0797 - accuracy: 0.9625\n",
      "Epoch 37/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0788 - accuracy: 0.9625\n",
      "Epoch 38/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0785 - accuracy: 0.9625\n",
      "Epoch 39/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0770 - accuracy: 0.9625\n",
      "Epoch 40/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0756 - accuracy: 0.9625\n",
      "Epoch 41/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0747 - accuracy: 0.9625\n",
      "Epoch 42/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0734 - accuracy: 0.9625\n",
      "Epoch 43/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0728 - accuracy: 0.9625\n",
      "Epoch 44/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0724 - accuracy: 0.9625\n",
      "Epoch 45/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0715 - accuracy: 0.9625\n",
      "Epoch 46/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0710 - accuracy: 0.9625\n",
      "Epoch 47/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0702 - accuracy: 0.9625\n",
      "Epoch 48/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0693 - accuracy: 0.9625\n",
      "Epoch 49/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0688 - accuracy: 0.9625\n",
      "Epoch 50/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0681 - accuracy: 0.9625\n",
      "Epoch 51/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0675 - accuracy: 0.9625\n",
      "Epoch 52/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0670 - accuracy: 0.9625\n",
      "Epoch 53/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0663 - accuracy: 0.9625\n",
      "Epoch 54/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0657 - accuracy: 0.9625\n",
      "Epoch 55/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0650 - accuracy: 0.9625\n",
      "Epoch 56/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0644 - accuracy: 0.9625\n",
      "Epoch 57/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0639 - accuracy: 0.9625\n",
      "Epoch 58/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0633 - accuracy: 0.9625\n",
      "Epoch 59/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0628 - accuracy: 0.9625\n",
      "Epoch 60/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0623 - accuracy: 0.9625\n",
      "Epoch 61/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0617 - accuracy: 0.9625\n",
      "Epoch 62/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0612 - accuracy: 0.9750\n",
      "Epoch 63/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0607 - accuracy: 0.9750\n",
      "Epoch 64/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0602 - accuracy: 0.9750\n",
      "Epoch 65/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0598 - accuracy: 0.9750\n",
      "Epoch 66/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0593 - accuracy: 0.9750\n",
      "Epoch 67/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0589 - accuracy: 0.9750\n",
      "Epoch 68/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0584 - accuracy: 0.9750\n",
      "Epoch 69/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0580 - accuracy: 0.9750\n",
      "Epoch 70/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0575 - accuracy: 0.9750\n",
      "Epoch 71/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0571 - accuracy: 0.9750\n",
      "Epoch 72/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0567 - accuracy: 0.9750\n",
      "Epoch 73/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0563 - accuracy: 0.9750\n",
      "Epoch 74/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0559 - accuracy: 0.9750\n",
      "Epoch 75/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0555 - accuracy: 0.9750\n",
      "Epoch 76/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0551 - accuracy: 0.9750\n",
      "Epoch 77/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0547 - accuracy: 0.9750\n",
      "Epoch 78/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0543 - accuracy: 0.9750\n",
      "Epoch 79/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0540 - accuracy: 0.9750\n",
      "Epoch 80/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0536 - accuracy: 0.9750\n",
      "Epoch 81/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0532 - accuracy: 0.9750\n",
      "Epoch 82/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0529 - accuracy: 0.9750\n",
      "Epoch 83/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0525 - accuracy: 0.9750\n",
      "Epoch 84/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0522 - accuracy: 0.9750\n",
      "Epoch 85/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0519 - accuracy: 0.9750\n",
      "Epoch 86/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0515 - accuracy: 0.9750\n",
      "Epoch 87/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0512 - accuracy: 0.9750\n",
      "Epoch 88/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0509 - accuracy: 0.9750\n",
      "Epoch 89/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0506 - accuracy: 0.9750\n",
      "Epoch 90/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0503 - accuracy: 0.9750\n",
      "Epoch 91/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0500 - accuracy: 0.9750\n",
      "Epoch 92/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0497 - accuracy: 0.9750\n",
      "Epoch 93/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0494 - accuracy: 0.9750\n",
      "Epoch 94/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0491 - accuracy: 0.9750\n",
      "Epoch 95/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0488 - accuracy: 0.9750\n",
      "Epoch 96/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0485 - accuracy: 0.9750\n",
      "Epoch 97/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0483 - accuracy: 0.9750\n",
      "Epoch 98/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0480 - accuracy: 0.9750\n",
      "Epoch 99/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0477 - accuracy: 0.9750\n",
      "Epoch 100/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0475 - accuracy: 0.9750\n",
      "Epoch 101/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0472 - accuracy: 0.9750\n",
      "Epoch 102/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0470 - accuracy: 0.9750\n",
      "Epoch 103/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0467 - accuracy: 0.9750\n",
      "Epoch 104/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0465 - accuracy: 0.9750\n",
      "Epoch 105/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0462 - accuracy: 0.9750\n",
      "Epoch 106/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0460 - accuracy: 0.9750\n",
      "Epoch 107/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0457 - accuracy: 0.9750\n",
      "Epoch 108/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0455 - accuracy: 0.9750\n",
      "Epoch 109/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0453 - accuracy: 0.9750\n",
      "Epoch 110/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0450 - accuracy: 0.9750\n",
      "Epoch 111/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0448 - accuracy: 0.9750\n",
      "Epoch 112/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0446 - accuracy: 0.9750\n",
      "Epoch 113/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0444 - accuracy: 0.9750\n",
      "Epoch 114/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0441 - accuracy: 0.9750\n",
      "Epoch 115/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0439 - accuracy: 0.9750\n",
      "Epoch 116/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0437 - accuracy: 0.9750\n",
      "Epoch 117/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0435 - accuracy: 0.9750\n",
      "Epoch 118/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0433 - accuracy: 0.9750\n",
      "Epoch 119/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0431 - accuracy: 0.9750\n",
      "Epoch 120/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0429 - accuracy: 0.9750\n",
      "Epoch 121/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0427 - accuracy: 0.9750\n",
      "Epoch 122/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0425 - accuracy: 0.9750\n",
      "Epoch 123/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0423 - accuracy: 0.9750\n",
      "Epoch 124/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0421 - accuracy: 0.9750\n",
      "Epoch 125/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0419 - accuracy: 0.9750\n",
      "Epoch 126/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0417 - accuracy: 0.9750\n",
      "Epoch 127/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0416 - accuracy: 0.9750\n",
      "Epoch 128/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0414 - accuracy: 0.9750\n",
      "Epoch 129/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0412 - accuracy: 0.9750\n",
      "Epoch 130/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0410 - accuracy: 0.9750\n",
      "Epoch 131/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0408 - accuracy: 0.9750\n",
      "Epoch 132/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0407 - accuracy: 0.9750\n",
      "Epoch 133/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0405 - accuracy: 0.9750\n",
      "Epoch 134/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0403 - accuracy: 0.9750\n",
      "Epoch 135/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0402 - accuracy: 0.9750\n",
      "Epoch 136/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0400 - accuracy: 0.9750\n",
      "Epoch 137/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0398 - accuracy: 0.9750\n",
      "Epoch 138/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0397 - accuracy: 0.9750\n",
      "Epoch 139/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0395 - accuracy: 0.9750\n",
      "Epoch 140/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0393 - accuracy: 0.9750\n",
      "Epoch 141/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0392 - accuracy: 0.9750\n",
      "Epoch 142/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0390 - accuracy: 0.9750\n",
      "Epoch 143/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0389 - accuracy: 0.9750\n",
      "Epoch 144/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0387 - accuracy: 0.9750\n",
      "Epoch 145/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0386 - accuracy: 0.9750\n",
      "Epoch 146/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0384 - accuracy: 0.9750\n",
      "Epoch 147/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0383 - accuracy: 0.9750\n",
      "Epoch 148/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0381 - accuracy: 0.9750\n",
      "Epoch 149/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0380 - accuracy: 0.9750\n",
      "Epoch 150/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0379 - accuracy: 0.9750\n",
      "Epoch 151/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0377 - accuracy: 0.9750\n",
      "Epoch 152/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0376 - accuracy: 0.9750\n",
      "Epoch 153/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0374 - accuracy: 0.9750\n",
      "Epoch 154/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0373 - accuracy: 0.9750\n",
      "Epoch 155/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0372 - accuracy: 0.9750\n",
      "Epoch 156/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0371 - accuracy: 0.9750\n",
      "Epoch 157/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0369 - accuracy: 0.9750\n",
      "Epoch 158/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0368 - accuracy: 0.9750\n",
      "Epoch 159/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0367 - accuracy: 0.9750\n",
      "Epoch 160/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0365 - accuracy: 0.9750\n",
      "Epoch 161/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0364 - accuracy: 0.9750\n",
      "Epoch 162/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0363 - accuracy: 0.9750\n",
      "Epoch 163/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0362 - accuracy: 0.9750\n",
      "Epoch 164/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0361 - accuracy: 0.9750\n",
      "Epoch 165/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0359 - accuracy: 0.9750\n",
      "Epoch 166/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0358 - accuracy: 0.9750\n",
      "Epoch 167/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0357 - accuracy: 0.9750\n",
      "Epoch 168/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0356 - accuracy: 0.9750\n",
      "Epoch 169/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0355 - accuracy: 0.9750\n",
      "Epoch 170/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0354 - accuracy: 0.9750\n",
      "Epoch 171/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0353 - accuracy: 0.9750\n",
      "Epoch 172/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0351 - accuracy: 0.9750\n",
      "Epoch 173/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0350 - accuracy: 0.9750\n",
      "Epoch 174/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0349 - accuracy: 0.9750\n",
      "Epoch 175/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0348 - accuracy: 0.9750\n",
      "Epoch 176/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0347 - accuracy: 0.9750\n",
      "Epoch 177/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0346 - accuracy: 0.9750\n",
      "Epoch 178/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0345 - accuracy: 0.9750\n",
      "Epoch 179/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0344 - accuracy: 0.9750\n",
      "Epoch 180/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0343 - accuracy: 0.9750\n",
      "Epoch 181/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0342 - accuracy: 0.9750\n",
      "Epoch 182/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0341 - accuracy: 0.9750\n",
      "Epoch 183/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0340 - accuracy: 0.9750\n",
      "Epoch 184/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0339 - accuracy: 0.9750\n",
      "Epoch 185/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0338 - accuracy: 0.9750\n",
      "Epoch 186/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0337 - accuracy: 0.9750\n",
      "Epoch 187/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0337 - accuracy: 0.9750\n",
      "Epoch 188/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0336 - accuracy: 0.9750\n",
      "Epoch 189/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0335 - accuracy: 0.9750\n",
      "Epoch 190/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0334 - accuracy: 0.9750\n",
      "Epoch 191/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0333 - accuracy: 0.9750\n",
      "Epoch 192/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0332 - accuracy: 0.9750\n",
      "Epoch 193/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0331 - accuracy: 0.9750\n",
      "Epoch 194/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0330 - accuracy: 0.9750\n",
      "Epoch 195/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0329 - accuracy: 0.9750\n",
      "Epoch 196/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0329 - accuracy: 0.9750\n",
      "Epoch 197/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0328 - accuracy: 0.9750\n",
      "Epoch 198/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0327 - accuracy: 0.9750\n",
      "Epoch 199/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0326 - accuracy: 0.9750\n",
      "Epoch 200/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0325 - accuracy: 0.9750\n",
      "Epoch 201/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0325 - accuracy: 0.9750\n",
      "Epoch 202/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0324 - accuracy: 0.9750\n",
      "Epoch 203/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0323 - accuracy: 0.9750\n",
      "Epoch 204/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0322 - accuracy: 0.9750\n",
      "Epoch 205/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0321 - accuracy: 0.9750\n",
      "Epoch 206/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0321 - accuracy: 0.9750\n",
      "Epoch 207/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0320 - accuracy: 0.9750\n",
      "Epoch 208/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0319 - accuracy: 0.9750\n",
      "Epoch 209/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0319 - accuracy: 0.9750\n",
      "Epoch 210/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0318 - accuracy: 0.9750\n",
      "Epoch 211/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0317 - accuracy: 0.9750\n",
      "Epoch 212/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0316 - accuracy: 0.9750\n",
      "Epoch 213/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0316 - accuracy: 0.9750\n",
      "Epoch 214/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0315 - accuracy: 0.9750\n",
      "Epoch 215/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0314 - accuracy: 0.9750\n",
      "Epoch 216/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0314 - accuracy: 0.9750\n",
      "Epoch 217/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0313 - accuracy: 0.9750\n",
      "Epoch 218/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0312 - accuracy: 0.9750\n",
      "Epoch 219/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0312 - accuracy: 0.9750\n",
      "Epoch 220/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0311 - accuracy: 0.9750\n",
      "Epoch 221/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0310 - accuracy: 0.9750\n",
      "Epoch 222/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0310 - accuracy: 0.9750\n",
      "Epoch 223/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0309 - accuracy: 0.9750\n",
      "Epoch 224/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0308 - accuracy: 0.9750\n",
      "Epoch 225/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0308 - accuracy: 0.9750\n",
      "Epoch 226/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0307 - accuracy: 0.9750\n",
      "Epoch 227/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0307 - accuracy: 0.9750\n",
      "Epoch 228/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0306 - accuracy: 0.9750\n",
      "Epoch 229/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0305 - accuracy: 0.9750\n",
      "Epoch 230/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0305 - accuracy: 0.9750\n",
      "Epoch 231/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0304 - accuracy: 0.9750\n",
      "Epoch 232/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0304 - accuracy: 0.9750\n",
      "Epoch 233/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0303 - accuracy: 0.9750\n",
      "Epoch 234/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0303 - accuracy: 0.9750\n",
      "Epoch 235/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0302 - accuracy: 0.9750\n",
      "Epoch 236/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0301 - accuracy: 0.9750\n",
      "Epoch 237/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0301 - accuracy: 0.9750\n",
      "Epoch 238/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0300 - accuracy: 0.9750\n",
      "Epoch 239/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0300 - accuracy: 0.9750\n",
      "Epoch 240/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0299 - accuracy: 0.9750\n",
      "Epoch 241/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0299 - accuracy: 0.9750\n",
      "Epoch 242/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0298 - accuracy: 0.9750\n",
      "Epoch 243/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0298 - accuracy: 0.9750\n",
      "Epoch 244/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0297 - accuracy: 0.9750\n",
      "Epoch 245/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0297 - accuracy: 0.9750\n",
      "Epoch 246/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0296 - accuracy: 0.9750\n",
      "Epoch 247/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0296 - accuracy: 0.9750\n",
      "Epoch 248/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0295 - accuracy: 0.9750\n",
      "Epoch 249/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0295 - accuracy: 0.9750\n",
      "Epoch 250/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0294 - accuracy: 0.9750\n",
      "Epoch 251/500\n",
      "2/2 [==============================] - 0s 7ms/step - loss: 0.0294 - accuracy: 0.9750\n",
      "Epoch 252/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0293 - accuracy: 0.9750\n",
      "Epoch 253/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0293 - accuracy: 0.9750\n",
      "Epoch 254/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0292 - accuracy: 0.9750\n",
      "Epoch 255/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0292 - accuracy: 0.9750\n",
      "Epoch 256/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0291 - accuracy: 0.9750\n",
      "Epoch 257/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0291 - accuracy: 0.9750\n",
      "Epoch 258/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0290 - accuracy: 0.9750\n",
      "Epoch 259/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0290 - accuracy: 0.9750\n",
      "Epoch 260/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0290 - accuracy: 0.9750\n",
      "Epoch 261/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0289 - accuracy: 0.9750\n",
      "Epoch 262/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0289 - accuracy: 0.9750\n",
      "Epoch 263/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0288 - accuracy: 0.9750\n",
      "Epoch 264/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0288 - accuracy: 0.9750\n",
      "Epoch 265/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0287 - accuracy: 0.9750\n",
      "Epoch 266/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0287 - accuracy: 0.9750\n",
      "Epoch 267/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0287 - accuracy: 0.9750\n",
      "Epoch 268/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0286 - accuracy: 0.9750\n",
      "Epoch 269/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0286 - accuracy: 0.9750\n",
      "Epoch 270/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0285 - accuracy: 0.9750\n",
      "Epoch 271/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0285 - accuracy: 0.9750\n",
      "Epoch 272/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0285 - accuracy: 0.9750\n",
      "Epoch 273/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0284 - accuracy: 0.9750\n",
      "Epoch 274/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0284 - accuracy: 0.9750\n",
      "Epoch 275/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0283 - accuracy: 0.9750\n",
      "Epoch 276/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0283 - accuracy: 0.9750\n",
      "Epoch 277/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0283 - accuracy: 0.9750\n",
      "Epoch 278/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0282 - accuracy: 0.9750\n",
      "Epoch 279/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0282 - accuracy: 0.9750\n",
      "Epoch 280/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0282 - accuracy: 0.9750\n",
      "Epoch 281/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0281 - accuracy: 0.9750\n",
      "Epoch 282/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0281 - accuracy: 0.9750\n",
      "Epoch 283/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0280 - accuracy: 0.9750\n",
      "Epoch 284/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0280 - accuracy: 0.9750\n",
      "Epoch 285/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0280 - accuracy: 0.9750\n",
      "Epoch 286/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0279 - accuracy: 0.9750\n",
      "Epoch 287/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0279 - accuracy: 0.9750\n",
      "Epoch 288/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0279 - accuracy: 0.9750\n",
      "Epoch 289/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0278 - accuracy: 0.9750\n",
      "Epoch 290/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0278 - accuracy: 0.9750\n",
      "Epoch 291/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0278 - accuracy: 0.9750\n",
      "Epoch 292/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0277 - accuracy: 0.9750\n",
      "Epoch 293/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0277 - accuracy: 0.9750\n",
      "Epoch 294/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0277 - accuracy: 0.9750\n",
      "Epoch 295/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0276 - accuracy: 0.9750\n",
      "Epoch 296/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0276 - accuracy: 0.9750\n",
      "Epoch 297/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0276 - accuracy: 0.9750\n",
      "Epoch 298/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0275 - accuracy: 0.9750\n",
      "Epoch 299/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0275 - accuracy: 0.9750\n",
      "Epoch 300/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0275 - accuracy: 0.9750\n",
      "Epoch 301/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0274 - accuracy: 0.9750\n",
      "Epoch 302/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0274 - accuracy: 0.9750\n",
      "Epoch 303/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0274 - accuracy: 0.9750\n",
      "Epoch 304/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0274 - accuracy: 0.9750\n",
      "Epoch 305/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0273 - accuracy: 0.9750\n",
      "Epoch 306/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0273 - accuracy: 0.9750\n",
      "Epoch 307/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0273 - accuracy: 0.9750\n",
      "Epoch 308/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0272 - accuracy: 0.9750\n",
      "Epoch 309/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0272 - accuracy: 0.9750\n",
      "Epoch 310/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0272 - accuracy: 0.9750\n",
      "Epoch 311/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0272 - accuracy: 0.9750\n",
      "Epoch 312/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0271 - accuracy: 0.9750\n",
      "Epoch 313/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0271 - accuracy: 0.9750\n",
      "Epoch 314/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0271 - accuracy: 0.9750\n",
      "Epoch 315/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0270 - accuracy: 0.9750\n",
      "Epoch 316/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0270 - accuracy: 0.9750\n",
      "Epoch 317/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0270 - accuracy: 0.9750\n",
      "Epoch 318/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0270 - accuracy: 0.9750\n",
      "Epoch 319/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0269 - accuracy: 0.9750\n",
      "Epoch 320/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0269 - accuracy: 0.9750\n",
      "Epoch 321/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0269 - accuracy: 0.9750\n",
      "Epoch 322/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0269 - accuracy: 0.9750\n",
      "Epoch 323/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0268 - accuracy: 0.9750\n",
      "Epoch 324/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0268 - accuracy: 0.9750\n",
      "Epoch 325/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0268 - accuracy: 0.9750\n",
      "Epoch 326/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0268 - accuracy: 0.9750\n",
      "Epoch 327/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0267 - accuracy: 0.9750\n",
      "Epoch 328/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0267 - accuracy: 0.9750\n",
      "Epoch 329/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0267 - accuracy: 0.9750\n",
      "Epoch 330/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0267 - accuracy: 0.9750\n",
      "Epoch 331/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0266 - accuracy: 0.9750\n",
      "Epoch 332/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0266 - accuracy: 0.9750\n",
      "Epoch 333/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0266 - accuracy: 0.9750\n",
      "Epoch 334/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0266 - accuracy: 0.9750\n",
      "Epoch 335/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0265 - accuracy: 0.9750\n",
      "Epoch 336/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0265 - accuracy: 0.9750\n",
      "Epoch 337/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0265 - accuracy: 0.9750\n",
      "Epoch 338/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0265 - accuracy: 0.9750\n",
      "Epoch 339/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0264 - accuracy: 0.9750\n",
      "Epoch 340/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0264 - accuracy: 0.9750\n",
      "Epoch 341/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0264 - accuracy: 0.9750\n",
      "Epoch 342/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0264 - accuracy: 0.9750\n",
      "Epoch 343/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0264 - accuracy: 0.9750\n",
      "Epoch 344/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0263 - accuracy: 0.9750\n",
      "Epoch 345/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0263 - accuracy: 0.9750\n",
      "Epoch 346/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0263 - accuracy: 0.9750\n",
      "Epoch 347/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0263 - accuracy: 0.9750\n",
      "Epoch 348/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0262 - accuracy: 0.9750\n",
      "Epoch 349/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0262 - accuracy: 0.9750\n",
      "Epoch 350/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0262 - accuracy: 0.9750\n",
      "Epoch 351/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0262 - accuracy: 0.9750\n",
      "Epoch 352/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0262 - accuracy: 0.9750\n",
      "Epoch 353/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0261 - accuracy: 0.9750\n",
      "Epoch 354/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0261 - accuracy: 0.9750\n",
      "Epoch 355/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0261 - accuracy: 0.9750\n",
      "Epoch 356/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0261 - accuracy: 0.9750\n",
      "Epoch 357/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0261 - accuracy: 0.9750\n",
      "Epoch 358/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 359/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 360/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 361/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 362/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 363/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0260 - accuracy: 0.9750\n",
      "Epoch 364/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0259 - accuracy: 0.9750\n",
      "Epoch 365/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0259 - accuracy: 0.9750\n",
      "Epoch 366/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0259 - accuracy: 0.9750\n",
      "Epoch 367/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0259 - accuracy: 0.9750\n",
      "Epoch 368/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0259 - accuracy: 0.9750\n",
      "Epoch 369/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 370/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 371/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 372/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 373/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 374/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0258 - accuracy: 0.9750\n",
      "Epoch 375/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0257 - accuracy: 0.9750\n",
      "Epoch 376/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0257 - accuracy: 0.9750\n",
      "Epoch 377/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0257 - accuracy: 0.9750\n",
      "Epoch 378/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0257 - accuracy: 0.9750\n",
      "Epoch 379/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0257 - accuracy: 0.9750\n",
      "Epoch 380/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 381/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 382/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 383/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 384/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 385/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 386/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0256 - accuracy: 0.9750\n",
      "Epoch 387/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 388/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 389/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 390/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 391/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 392/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0255 - accuracy: 0.9750\n",
      "Epoch 393/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 394/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 395/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 396/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 397/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 398/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 399/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0254 - accuracy: 0.9750\n",
      "Epoch 400/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 401/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 402/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 403/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 404/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 405/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 406/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0253 - accuracy: 0.9750\n",
      "Epoch 407/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 408/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 409/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 410/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 411/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 412/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 413/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0252 - accuracy: 0.9750\n",
      "Epoch 414/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 415/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 416/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 417/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 418/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 419/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 420/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 421/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0251 - accuracy: 0.9750\n",
      "Epoch 422/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 423/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 424/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 425/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 426/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 427/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 428/500\n",
      "2/2 [==============================] - 0s 9ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 429/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0250 - accuracy: 0.9750\n",
      "Epoch 430/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 431/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 432/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 433/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 434/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 435/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 436/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 437/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 438/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0249 - accuracy: 0.9750\n",
      "Epoch 439/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 440/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 441/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 442/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 443/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 444/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 445/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 446/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 447/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0248 - accuracy: 0.9750\n",
      "Epoch 448/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 449/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 450/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 451/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 452/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 453/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 454/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 455/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 456/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0247 - accuracy: 0.9750\n",
      "Epoch 457/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 458/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 459/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 460/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 461/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 462/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 463/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 464/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 465/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 466/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 467/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0246 - accuracy: 0.9750\n",
      "Epoch 468/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 469/500\n",
      "2/2 [==============================] - 0s 7ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 470/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 471/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 472/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 473/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 474/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 475/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 476/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 477/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 478/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0245 - accuracy: 0.9750\n",
      "Epoch 479/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 480/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 481/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 482/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 483/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 484/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 485/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 486/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 487/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 488/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 489/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0244 - accuracy: 0.9750\n",
      "Epoch 490/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 491/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 492/500\n",
      "2/2 [==============================] - 0s 2ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 493/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 494/500\n",
      "2/2 [==============================] - 0s 4ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 495/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 496/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 497/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 498/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 499/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n",
      "Epoch 500/500\n",
      "2/2 [==============================] - 0s 3ms/step - loss: 0.0243 - accuracy: 0.9750\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x7fe2c87bdd50>"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fit(train_dataset,epochs=params['epochs'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
